package com.ny.zmb.glxt.entity;

import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * <p>
 * 店铺
 * </p>
 *
 * @author xie
 * @since 2024-10-10
 */
@TableName("pm_store")
@ApiModel(value = "PmStore对象", description = "店铺")
@Data
@Builder
@AllArgsConstructor
public class PmStore implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty("所属会员")
    private Integer userId;

    @ApiModelProperty("店铺名称")
    private String name;

    @ApiModelProperty("LOGO")
    private String logo;

    @ApiModelProperty("轮播图")
    private String banner;

    @ApiModelProperty("联系电话")
    private String phone;

    @ApiModelProperty("联系人")
    private String linkMan;

    @ApiModelProperty("营业执照")
    private String licence;

    @ApiModelProperty("省")
    private String province;

    @ApiModelProperty("市")
    private String city;

    @ApiModelProperty("县")
    private String area;

    @ApiModelProperty("乡/街道")
    private String zhen;

    @ApiModelProperty("详细地址")
    private String address;

    @ApiModelProperty("经度")
    private BigDecimal lng;

    @ApiModelProperty("纬度")
    private BigDecimal lat;

    @ApiModelProperty("所属分类")
    private Integer cateId;

    @ApiModelProperty("营业时间")
    private String workTime;

    @ApiModelProperty("驳回理由 - 2024-8-19新增")
    private String statusRe;

    @ApiModelProperty("状态,1正常，0待审核，2驳回，3关闭")
    private Byte status;

    @ApiModelProperty("类型")
    private Byte type;

    @ApiModelProperty("入驻时间")
    private long addTime;

    @ApiModelProperty("保证业绩，达到后允许提现")
    private BigDecimal ensureMoney;

    @ApiModelProperty("申请类型，1店铺，2乡镇代理，3区县代理，4市级代理，5省级代理，6大区代理，7云仓")
    private Boolean reqType;

    @ApiModelProperty("省代理")
    private Integer dlProvinceId;

    @ApiModelProperty("市代理")
    private Integer dlCityId;

    @ApiModelProperty("县区代理")
    private Integer dlAreaId;

    @ApiModelProperty("乡镇代理")
    private Integer dlZhenId;

    @ApiModelProperty("大区")
    private Integer dlQuId;

    @ApiModelProperty("推荐人")
    private String pid;

    @ApiModelProperty("审核时间")
    private Integer checkTime;

    private Boolean isCheck;

    @ApiModelProperty("身份证正反面 - 2024-8-1 新增")
    private String icp;

    @ApiModelProperty("电子协议ID - 2024-8-1 新增")
    private Integer epId;

    @ApiModelProperty("电子协议详细内容 - 2024-8-1 新增")
    private String epContent;

    @ApiModelProperty("电子协议签名 - 2024-8-6 新增")
    private String epContentQm;

    @ApiModelProperty("对赌协议ID")
    private String epIdD;

    @ApiModelProperty("对赌协议内容")
    private String epContentD;

    @ApiModelProperty("对赌协议签名")
    private String epContentQmD;

    @ApiModelProperty("银盛ID")
    @TableField("sysFlowId")
    private String sysFlowId;

    @ApiModelProperty("担保协议id")
    private String epIdDbxy;

    @ApiModelProperty("担保协议内容")
    private String epContentDbxy;

    @ApiModelProperty("担保协议签名")
    private String epContentQmDbxy;

    @ApiModelProperty("商户号")
    private String businessNo;

    @ApiModelProperty("外部商户号")
    private String outMerchantNo;

    public String judgeStatus() {
        switch (status) {
            case 0:
                return "待审核";
            case 1:
                return "正常";
            case 2:
                return "驳回";
            case 3:
                return "关闭";
            default:
                return "unKnow";
        }
    }

    public PmStore() {
        this.status = 0;
        this.addTime = System.currentTimeMillis() / 1000;
    }

    public PmStore(Integer userId) {
        this.userId = userId;
        this.status = 0;
        this.addTime = System.currentTimeMillis() / 1000;
    }
    public PmStore(Integer userId,String outMerchantNo) {
        this.userId = userId;
        this.outMerchantNo = outMerchantNo;
        this.status = 0;
        this.addTime = System.currentTimeMillis() / 1000;

    }

    public PmStore typeChange(JSONObject jsonObject) {
        return this;
    }

    public void setNullToEmpty() {
    }
}
